package demo_0416;

import java.io.File;
import java.io.IOException;

public class Test {
    public static void main(String[] args) {
        File file = new File("../abc.txt");
        File file1 = new File("../xxx.txt");
        System.out.println(file.getAbsoluteFile());
        try {
            System.out.println(file.getCanonicalFile());
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        System.out.println(file.getParent());
        System.out.println(file.exists());
        file.renameTo(file1);
        File[] files = File.listRoots();
        for (File f : files) {
            System.out.println(f);
        }
    }
}
